package Demo_3;

public class Thread_Demo {
    public static void main(String[] args) {
        Thread thread = new Thread(() -> {
                System.out.println("我的名字：" + Thread.currentThread().getName());
        });
        System.out.println(thread.getName() + "Id:" + thread.getId());
        System.out.println(thread.getName() + "状态:" + thread.getState());
        System.out.println(thread.getName() + "优先级:" + thread.getPriority());
        System.out.println(thread.getName() + "后台线程:" + thread.isDaemon());
        System.out.println(thread.getName() + "活着:" + thread.isAlive());
        System.out.println(thread.getName() + "被中断:" + thread.isInterrupted());
        thread.start();
        //执行后
        System.out.println(thread.getName() + "后台线程:" + thread.isDaemon());
        System.out.println(thread.getName() + "活着:" + thread.isAlive());
        System.out.println(thread.getName() + "被中断:" + thread.isInterrupted());

    }

}
